﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.ZY
{
    /// <summary>
    /// 生命附加福满堂重大疾病保险
    /// </summary>
    class Class5
    {
        /// <summary>
        /// 重大疾病保险金给付
        /// </summary>
        /// <param name="ppa"></param>
        /// <param name="da"></param>
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
           
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重疾"))
            {
                da.Value = ppa.Amount;

                ppa.IsCurrentFinish = true;

                double bo = ppa.SchemePeriodActing.BasicPolicyPeriodActing.Amount;

                double bn = bo - ppa.Amount;

                ppa.SchemePeriodActing.BasicPolicyPeriodActing.Amount = bn;

                double fee = ppa.SchemePeriodActing.BasicPolicyPeriodActing.Fee;

                ppa.SchemePeriodActing.BasicPolicyPeriodActing.Fee = fee * bn / bo;

            }
        }

        /// <summary>
        /// 医疗关护金给付
        /// </summary>
        /// <param name="ppa"></param>
        /// <param name="da"></param>
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.SchemePeriodActing.InsurantStates.Contains("轻症疾病"))
            {
                da.Value = ppa.Amount * 0.2;

                da.Description = "最大金额";

            }
        }
    }
}
